-
Notifications
You must be signed in to change notification settings - Fork 344
[clang Dependency Scanning] Out-of-Date Scanning File System Cache Entry Reporting C-APIs #10927
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Note to reviewers: I don't see a good way to cleanly test these APIs through c-index tests. Ideally, I'd like to create an underlying service whose file system cache I can manipulate directly to test these APIs directly (something similar to https://github.com/llvm/llvm-project/pull/144105/files#diff-25ec4b41a8aed83f312f2bb7b409f379f38dd9d1597d6e4e45e17681260dfcc2R205). Do we think it is reasonable to create unit tests for these C-APIs? If so, I will try making some unit tests. |
…cative and concise.
@swift-ci please test llvm. |
@swift-ci please test llvm. |
The two failing tests do not relate to this PR. rdar://154865941 is tracking them. |
Gentle ping for review. Thanks! |
clang/unittests/libclang/DependencyScanningFSCacheOutOfDateTests.cpp
Outdated
Show resolved
Hide resolved
Adding the unit test is a nice bonus, but I'd be in favor in keeping the old |
This is a good point. The difficulty is that it is not easy to create out-date-entries exactly as we desired to make sure we have good coverage of all the APIs. I can recover the removed |
@swift-ci please test llvm. |
clang/unittests/libclang/DependencyScanningFSCacheOutOfDateTests.cpp
Outdated
Show resolved
Hide resolved
clang/unittests/libclang/DependencyScanningFSCacheOutOfDateTests.cpp
Outdated
Show resolved
Hide resolved
clang/unittests/libclang/DependencyScanningFSCacheOutOfDateTests.cpp
Outdated
Show resolved
Hide resolved
@swift-ci please test llvm. |
…ook at directories for size changes.
@swift-ci please test llvm. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, thank you! LGTM sans the small nits.
clang/lib/Tooling/DependencyScanning/DependencyScanningFilesystem.cpp
Outdated
Show resolved
Hide resolved
clang/lib/Tooling/DependencyScanning/DependencyScanningFilesystem.cpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think changes here should also go upstream, right? (It's fine to do as a follow-up to reduce churn and waiting.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup I agree! I will make an upstream PR afterwards.
@swift-ci please test llvm. |
I took a look at the failing tests and they are not related to this PR. I am landing the PR. Thanks so much for the detailed review @jansvoboda11 ! |
This PR implements the C-APIs to report a scanning file system cache's out-of-date entries. The C-APIs contains a function to return a set of file system cache out-of-date entries, functions to facilitate looping through all the entries, and reporting the relevant information from the entries.
The APIs are based on llvm#144105.
rdar://152247357